package Underworld_Survival;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Ability implements Serializable {
    private List<Skill> activeSkill;//技能列表

    public Ability(){//用于主角的初始化
        this.activeSkill= new ArrayList<Skill>() {{add(new desperate_counterattack());}};//初始获得绝地反击
    }
    public Ability(List<Skill> activeSkill){this.activeSkill=activeSkill;}//直接传入所有技能

    public void showActiveSkill(){//展示所有技能
        if(!activeSkill.isEmpty()){
            System.out.println("技能：");
            for(int i=1;i<activeSkill.size();i++){
                System.out.println(i+"."+activeSkill.get(i).getSkillName()+" "+'\t'+"消耗："+
                    activeSkill.get(i).getConsumeAgi()+"能量"+'\t'+"效果："+ activeSkill.get(i).getSkillEffect());
            }
        }else{
            System.out.println("！！！没有任何技能！！！");
        }
    }

    public List<Skill> getActiveSkill() {return activeSkill;}
    public void setActiveSkill(List<Skill> activeSkill) {this.activeSkill = activeSkill;}

}
